package com.example.entity;

import com.fasterxml.jackson.dataformat.xml.annotation.*;
import lombok.Data;

import java.util.List;

@Data
@JacksonXmlRootElement
public class Conversations {

    @JacksonXmlProperty(isAttribute = true,localName = "xsi:noNamespaceSchemaLocation")
    private String location = "combi-conversations_v1.2.xsd";
    @JacksonXmlProperty(isAttribute = true, localName = "xmlns:xsi")
    private String xmlns = "http://www.w3.org/2001/XMLSchema-instance";

    @JacksonXmlElementWrapper(useWrapping = false)
    private List<Conversation> conversation;

    @Data
    public static class Conversation{

        private String startEpoch;

        private String subject;

        @JacksonXmlCData
        private String mode;
        @JacksonXmlElementWrapper(localName = "User")
        private List<User> message;

        @Data
        public static class User{
            private String userID;
            private String email;
            private String displayName;
        }
    }
}
